.class abstract Lcom/greystripe/sdk/w;
.super Ljava/lang/Object;

# interfaces
.implements Lcom/greystripe/sdk/x;


# instance fields
.field protected a:Lcom/greystripe/sdk/y;

.field private b:Lcom/greystripe/sdk/c;


# direct methods
.method public constructor <init>(Lcom/greystripe/sdk/c;)V
    .locals 0

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    iput-object p1, p0, Lcom/greystripe/sdk/w;->b:Lcom/greystripe/sdk/c;

    return-void
.end method

.method private a(Ljava/lang/String;)V
    .locals 3

    iget-object v0, p0, Lcom/greystripe/sdk/w;->b:Lcom/greystripe/sdk/c;

    if-nez v0, :cond_0

    :goto_0
    return-void

    :cond_0
    iget-object v0, p0, Lcom/greystripe/sdk/w;->b:Lcom/greystripe/sdk/c;

    invoke-virtual {v0}, Lcom/greystripe/sdk/c;->j()Lcom/greystripe/sdk/aa;

    move-result-object v0

    new-instance v1, Ljava/lang/StringBuilder;

    const-string v2, "EventHandler.broadcastEvent(\'"

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, "\');"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/greystripe/sdk/aa;->b(Ljava/lang/String;)V

    goto :goto_0
.end method


# virtual methods
.method public canPause()Z
    .locals 3
    .annotation runtime Landroid/webkit/JavascriptInterface;
    .end annotation

    const/4 v0, 0x0

    iget-object v1, p0, Lcom/greystripe/sdk/w;->a:Lcom/greystripe/sdk/y;

    if-nez v1, :cond_0

    const-string v1, "videoView was null"

    new-array v2, v0, [Ljava/lang/Object;

    invoke-static {v1, v2}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    :goto_0
    return v0

    :cond_0
    :try_start_0
    iget-object v1, p0, Lcom/greystripe/sdk/w;->a:Lcom/greystripe/sdk/y;

    invoke-virtual {v1}, Lcom/greystripe/sdk/y;->canPause()Z
    :try_end_0
    .catch Ljava/lang/IllegalStateException; {:try_start_0 .. :try_end_0} :catch_0

    move-result v0

    goto :goto_0

    :catch_0
    move-exception v1

    const-string v1, "CAUGHT: IllegalStateException at canPause"

    new-array v2, v0, [Ljava/lang/Object;

    invoke-static {v1, v2}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    goto :goto_0
.end method

.method public canSeekBackward()Z
    .locals 3
    .annotation runtime Landroid/webkit/JavascriptInterface;
    .end annotation

    const/4 v0, 0x0

    iget-object v1, p0, Lcom/greystripe/sdk/w;->a:Lcom/greystripe/sdk/y;

    if-nez v1, :cond_0

    const-string v1, "videoView was null"

    new-array v2, v0, [Ljava/lang/Object;

    invoke-static {v1, v2}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    :goto_0
    return v0

    :cond_0
    :try_start_0
    iget-object v1, p0, Lcom/greystripe/sdk/w;->a:Lcom/greystripe/sdk/y;

    invoke-virtual {v1}, Lcom/greystripe/sdk/y;->canSeekBackward()Z
    :try_end_0
    .catch Ljava/lang/IllegalStateException; {:try_start_0 .. :try_end_0} :catch_0

    move-result v0

    goto :goto_0

    :catch_0
    move-exception v1

    const-string v1, "CAUGHT: IllegalStateException at canSeekBackward"

    new-array v2, v0, [Ljava/lang/Object;

    invoke-static {v1, v2}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    goto :goto_0
.end method

.method public canSeekForward()Z
    .locals 3
    .annotation runtime Landroid/webkit/JavascriptInterface;
    .end annotation

    const/4 v0, 0x0

    iget-object v1, p0, Lcom/greystripe/sdk/w;->a:Lcom/greystripe/sdk/y;

    if-nez v1, :cond_0

    const-string v1, "videoView was null"

    new-array v2, v0, [Ljava/lang/Object;

    invoke-static {v1, v2}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    :goto_0
    return v0

    :cond_0
    :try_start_0
    iget-object v1, p0, Lcom/greystripe/sdk/w;->a:Lcom/greystripe/sdk/y;

    invoke-virtual {v1}, Lcom/greystripe/sdk/y;->canSeekForward()Z
    :try_end_0
    .catch Ljava/lang/IllegalStateException; {:try_start_0 .. :try_end_0} :catch_0

    move-result v0

    goto :goto_0

    :catch_0
    move-exception v1

    const-string v1, "CAUGHT: IllegalStateException at canSeekForward"

    new-array v2, v0, [Ljava/lang/Object;

    invoke-static {v1, v2}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    goto :goto_0
.end method

.method public getBufferPercentage()I
    .locals 3
    .annotation runtime Landroid/webkit/JavascriptInterface;
    .end annotation

    const/4 v2, 0x0

    const/4 v0, -0x1

    iget-object v1, p0, Lcom/greystripe/sdk/w;->a:Lcom/greystripe/sdk/y;

    if-nez v1, :cond_0

    const-string v1, "videoView was null"

    new-array v2, v2, [Ljava/lang/Object;

    invoke-static {v1, v2}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    :goto_0
    return v0

    :cond_0
    :try_start_0
    iget-object v1, p0, Lcom/greystripe/sdk/w;->a:Lcom/greystripe/sdk/y;

    invoke-virtual {v1}, Lcom/greystripe/sdk/y;->getBufferPercentage()I
    :try_end_0
    .catch Ljava/lang/IllegalStateException; {:try_start_0 .. :try_end_0} :catch_0

    move-result v0

    goto :goto_0

    :catch_0
    move-exception v1

    const-string v1, "CAUGHT: IllegalStateException at getBufferPercentage"

    new-array v2, v2, [Ljava/lang/Object;

    invoke-static {v1, v2}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    goto :goto_0
.end method

.method public getCurrentTime()D
    .locals 4
    .annotation runtime Landroid/webkit/JavascriptInterface;
    .end annotation

    const/4 v3, 0x0

    const-wide/high16 v0, -0x4010

    iget-object v2, p0, Lcom/greystripe/sdk/w;->a:Lcom/greystripe/sdk/y;

    if-nez v2, :cond_0

    const-string v2, "videoView was null"

    new-array v3, v3, [Ljava/lang/Object;

    invoke-static {v2, v3}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    :goto_0
    return-wide v0

    :cond_0
    :try_start_0
    iget-object v2, p0, Lcom/greystripe/sdk/w;->a:Lcom/greystripe/sdk/y;

    invoke-virtual {v2}, Lcom/greystripe/sdk/y;->getCurrentPosition()I
    :try_end_0
    .catch Ljava/lang/IllegalStateException; {:try_start_0 .. :try_end_0} :catch_0

    move-result v0

    int-to-double v0, v0

    const-wide v2, 0x408f400000000000L

    div-double/2addr v0, v2

    goto :goto_0

    :catch_0
    move-exception v2

    const-string v2, "CAUGHT: IllegalStateException at getCurrentTime"

    new-array v3, v3, [Ljava/lang/Object;

    invoke-static {v2, v3}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    goto :goto_0
.end method

.method public getDuration()D
    .locals 4
    .annotation runtime Landroid/webkit/JavascriptInterface;
    .end annotation

    const/4 v3, 0x0

    const-wide/high16 v0, -0x4010

    iget-object v2, p0, Lcom/greystripe/sdk/w;->a:Lcom/greystripe/sdk/y;

    if-nez v2, :cond_0

    const-string v2, "videoView was null"

    new-array v3, v3, [Ljava/lang/Object;

    invoke-static {v2, v3}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    :goto_0
    return-wide v0

    :cond_0
    :try_start_0
    iget-object v2, p0, Lcom/greystripe/sdk/w;->a:Lcom/greystripe/sdk/y;

    invoke-virtual {v2}, Lcom/greystripe/sdk/y;->getDuration()I
    :try_end_0
    .catch Ljava/lang/IllegalStateException; {:try_start_0 .. :try_end_0} :catch_0

    move-result v0

    int-to-double v0, v0

    const-wide v2, 0x408f400000000000L

    div-double/2addr v0, v2

    goto :goto_0

    :catch_0
    move-exception v2

    const-string v2, "CAUGHT: IllegalStateException at getDuration"

    new-array v3, v3, [Ljava/lang/Object;

    invoke-static {v2, v3}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    goto :goto_0
.end method

.method public isPlaying()Z
    .locals 3
    .annotation runtime Landroid/webkit/JavascriptInterface;
    .end annotation

    const/4 v0, 0x0

    iget-object v1, p0, Lcom/greystripe/sdk/w;->a:Lcom/greystripe/sdk/y;

    if-nez v1, :cond_0

    const-string v1, "videoView was null"

    new-array v2, v0, [Ljava/lang/Object;

    invoke-static {v1, v2}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    :goto_0
    return v0

    :cond_0
    :try_start_0
    iget-object v1, p0, Lcom/greystripe/sdk/w;->a:Lcom/greystripe/sdk/y;

    invoke-virtual {v1}, Lcom/greystripe/sdk/y;->isPlaying()Z
    :try_end_0
    .catch Ljava/lang/IllegalStateException; {:try_start_0 .. :try_end_0} :catch_0

    move-result v0

    goto :goto_0

    :catch_0
    move-exception v1

    const-string v1, "CAUGHT: IllegalStateException at isPlaying"

    new-array v2, v0, [Ljava/lang/Object;

    invoke-static {v1, v2}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    goto :goto_0
.end method

.method public onCompletion()V
    .locals 1

    const-string v0, "videooncompletion"

    invoke-direct {p0, v0}, Lcom/greystripe/sdk/w;->a(Ljava/lang/String;)V

    return-void
.end method

.method public onPause()V
    .locals 1

    const-string v0, "videoonpause"

    invoke-direct {p0, v0}, Lcom/greystripe/sdk/w;->a(Ljava/lang/String;)V

    return-void
.end method

.method public onPlay()V
    .locals 1

    const-string v0, "videoonplay"

    invoke-direct {p0, v0}, Lcom/greystripe/sdk/w;->a(Ljava/lang/String;)V

    return-void
.end method

.method public onPrepared()V
    .locals 1

    const-string v0, "videoonprepared"

    invoke-direct {p0, v0}, Lcom/greystripe/sdk/w;->a(Ljava/lang/String;)V

    return-void
.end method

.method public onTimeUpdate()V
    .locals 1

    const-string v0, "videoontimeupdate"

    invoke-direct {p0, v0}, Lcom/greystripe/sdk/w;->a(Ljava/lang/String;)V

    return-void
.end method

.method public onTouchCancel()V
    .locals 1

    const-string v0, "videoontouchcancel"

    invoke-direct {p0, v0}, Lcom/greystripe/sdk/w;->a(Ljava/lang/String;)V

    return-void
.end method

.method public onTouchEnd()V
    .locals 1

    const-string v0, "videoontouchend"

    invoke-direct {p0, v0}, Lcom/greystripe/sdk/w;->a(Ljava/lang/String;)V

    return-void
.end method

.method public onTouchMove()V
    .locals 1

    const-string v0, "videoontouchmove"

    invoke-direct {p0, v0}, Lcom/greystripe/sdk/w;->a(Ljava/lang/String;)V

    return-void
.end method

.method public onTouchStart()V
    .locals 1

    const-string v0, "videoontouchstart"

    invoke-direct {p0, v0}, Lcom/greystripe/sdk/w;->a(Ljava/lang/String;)V

    return-void
.end method

.method public onVideoExit()V
    .locals 1

    const-string v0, "videoonexit"

    invoke-direct {p0, v0}, Lcom/greystripe/sdk/w;->a(Ljava/lang/String;)V

    return-void
.end method

.method public pause()V
    .locals 2
    .annotation runtime Landroid/webkit/JavascriptInterface;
    .end annotation

    const/4 v1, 0x0

    iget-object v0, p0, Lcom/greystripe/sdk/w;->a:Lcom/greystripe/sdk/y;

    if-nez v0, :cond_0

    const-string v0, "videoView was null"

    new-array v1, v1, [Ljava/lang/Object;

    invoke-static {v0, v1}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    :goto_0
    return-void

    :cond_0
    :try_start_0
    iget-object v0, p0, Lcom/greystripe/sdk/w;->a:Lcom/greystripe/sdk/y;

    invoke-virtual {v0}, Lcom/greystripe/sdk/y;->pause()V
    :try_end_0
    .catch Ljava/lang/IllegalStateException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v0

    const-string v0, "CAUGHT: IllegalStateException at pause"

    new-array v1, v1, [Ljava/lang/Object;

    invoke-static {v0, v1}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    goto :goto_0
.end method

.method public seekTo(I)V
    .locals 2
    .annotation runtime Landroid/webkit/JavascriptInterface;
    .end annotation

    const/4 v1, 0x0

    iget-object v0, p0, Lcom/greystripe/sdk/w;->a:Lcom/greystripe/sdk/y;

    if-nez v0, :cond_0

    const-string v0, "videoView was null"

    new-array v1, v1, [Ljava/lang/Object;

    invoke-static {v0, v1}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    :goto_0
    return-void

    :cond_0
    :try_start_0
    iget-object v0, p0, Lcom/greystripe/sdk/w;->a:Lcom/greystripe/sdk/y;

    invoke-virtual {v0, p1}, Lcom/greystripe/sdk/y;->seekTo(I)V
    :try_end_0
    .catch Ljava/lang/IllegalStateException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v0

    const-string v0, "CAUGHT: IllegalStateException at seekTo"

    new-array v1, v1, [Ljava/lang/Object;

    invoke-static {v0, v1}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    goto :goto_0
.end method

.method public start()V
    .locals 2
    .annotation runtime Landroid/webkit/JavascriptInterface;
    .end annotation

    const/4 v1, 0x0

    iget-object v0, p0, Lcom/greystripe/sdk/w;->a:Lcom/greystripe/sdk/y;

    if-nez v0, :cond_0

    const-string v0, "videoView was null"

    new-array v1, v1, [Ljava/lang/Object;

    invoke-static {v0, v1}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    :goto_0
    return-void

    :cond_0
    :try_start_0
    iget-object v0, p0, Lcom/greystripe/sdk/w;->a:Lcom/greystripe/sdk/y;

    invoke-virtual {v0}, Lcom/greystripe/sdk/y;->start()V
    :try_end_0
    .catch Ljava/lang/IllegalStateException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v0

    const-string v0, "CAUGHT: IllegalStateException at start"

    new-array v1, v1, [Ljava/lang/Object;

    invoke-static {v0, v1}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    goto :goto_0
.end method
